// 封装所有的与权限相关的网络请求
import instance from "@/utils/request";


// 根据ID更新权限点详情
export function updatePermissionAPI(data) {
  return instance({
    url: `/sys/permission/${data.id}`,
    method: 'put',
    data
  })
}

//根据ID获取权限点详情
export function getPermissionApi(id) {
  return instance({
    url: `/sys/permission/${id}`,
  })
}

//根据id删除权限点
export function delPermissionApi(id) {
  return instance({
    url: `/sys/permission/${id}`,
    method: 'delete',

  })
}

//添加权限点
export function addPermissionApi(data) {
  return instance({
    url: `/sys/permission`,
    method: 'post',
    data
  })
}

// 获取所有权限点
export function getPermissionAllApi() {
  return instance({
    url: `/sys/permission`
  })
}
